#include "mainwindow.h"
#include "ui_mainwindow.h"


MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    ui->listWidget->addItems(QStringList()<<"MUSIC"<<"GAME");
    pmusic = new Music(ui->frame);
    pGame = new Game(ui->frame);
    pmusic->hide();
    pGame->hide();

}

MainWindow::~MainWindow()
{
    delete ui;
}


void MainWindow::on_listWidget_itemClicked(QListWidgetItem *item)
{
    if(item->text() == "MUSIC")
    {
        pmusic->show();
         pGame->hide();
    }
    if(item->text() == "GAME")
    {
        pGame->show();
         pmusic->hide();
    }
}

